From: awilliam@xenbuild.aw Date: Tue, 9 May 2006 17:41:06 +0000 (-0600) Subject: [IA64] linux: grant table hypercall work around X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16101 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=9659a82e51a423043169f303152e5c7df80a9922;p=xen.git [IA64] linux: grant table hypercall work around Current xen/ia64 grant table ignores some GNTMAP_xxx flags. work around for that. This patch will be removed once the flags are supported. Signed-off-by: Isaku Yamahata --- diff --git a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c index 306027c89f..91b3bf39b7 100644 --- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c +++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c @@ -200,6 +200,59 @@ out: } +/////////////////////////////////////////////////////////////////////////// +// grant table hack +// cmd: GNTTABOP_xxx + +#include +#include +#include + +static void +gnttab_map_grant_ref_pre(struct gnttab_map_grant_ref *uop) +{ + uint32_t flags; + + flags = uop->flags; + if (flags & GNTMAP_readonly) { +#if 0 + xprintd("GNTMAP_readonly is not supported yet\n"); +#endif + flags &= ~GNTMAP_readonly; + } + + if (flags & GNTMAP_host_map) { + if (flags & GNTMAP_application_map) { + xprintd("GNTMAP_application_map is not supported yet: flags 0x%x\n", flags); + BUG(); + } + if (flags & GNTMAP_contains_pte) { + xprintd("GNTMAP_contains_pte is not supported yet flags 0x%x\n", flags); + BUG(); + } + } else if (flags & GNTMAP_device_map) { + xprintd("GNTMAP_device_map is not supported yet 0x%x\n", flags); + BUG();//XXX not yet. actually this flag is not used. + } else { + BUG(); + } +} + +int +HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count) +{ + if (cmd == GNTTABOP_map_grant_ref) { + unsigned int i; + for (i = 0; i < count; i++) { + gnttab_map_grant_ref_pre( + (struct gnttab_map_grant_ref*)uop + i); + } + } + + return ____HYPERVISOR_grant_table_op(cmd, uop, count); +} + + /////////////////////////////////////////////////////////////////////////// //XXX taken from balloon.c // temporal hack until balloon driver support. diff --git a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h index c30d5c0d10..d81e4d1598 100644 --- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h @@ -244,12 +244,19 @@ HYPERVISOR_physdev_op( return rc; } +//XXX __HYPERVISOR_grant_table_op is used for this hypercall constant. static inline int -HYPERVISOR_grant_table_op( +____HYPERVISOR_grant_table_op( unsigned int cmd, void *uop, unsigned int count) { return _hypercall3(int, grant_table_op, cmd, uop, count); } +#ifndef CONFIG_XEN_IA64_DOM0_VP +#define HYPERVISOR_grant_table_op(cmd, uop, count) \ + ____HYPERVISOR_grant_table_op((cmd), (uop), (count)) +#else +int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count); +#endif static inline int HYPERVISOR_vcpu_op(